package com.dayu.web.controller.recovery;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.dayu.common.annotation.Log;
import com.dayu.common.core.controller.BaseController;
import com.dayu.common.core.domain.AjaxResult;
import com.dayu.common.enums.BusinessType;
import com.dayu.recovery.domain.SalePriceLog;
import com.dayu.recovery.service.ISalePriceLogService;
import com.dayu.common.core.page.TableDataInfo;
import javax.annotation.Resource;

/**
 * 预售价日志Controller
 *
 * @author HK
 * @date 2022-03-21
 */
@RestController
@RequestMapping("/recovery/priceLog")
public class SalePriceLogController extends BaseController
{
    @Resource
    private ISalePriceLogService salePriceLogService;

    /**
     * 查询预售价日志列表
     */
    @GetMapping("/list")
    public TableDataInfo list(SalePriceLog salePriceLog)
    {
        startPage();
        List<SalePriceLog> list = salePriceLogService.selectSalePriceLogList(salePriceLog);
        return getDataTable(list);
    }

    /**
     * 删除预售价日志
     */
    @Log(title = "删除预售日志", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long ids)
    {
        return toAjax(salePriceLogService.deleteSalePriceLogByIds(ids));
    }
}
